<template>
	<view class="user pageBg">
		<custom-nav-bar></custom-nav-bar>
		<view class="info">
			<view class="avatar">
				<image class="user-avatar" src="../../static/images/xxmLogo.png"></image>
			</view>
			<view class="ip">100.100.100.100</view>
			<view class="name">来自: 浙江</view>
		</view>
		<view class="section">
			<view class="list">
				<navigator class="row">
					<view class="left">
						<uni-icons type="download" size="20"></uni-icons>
						<view class="text">我的下载</view>
					</view>
					<view class="right">
						<view class="text">33</view>
						<uni-icons type="right" color="#aaa" size="16"></uni-icons>
					</view>
				</navigator>
				<navigator class="row">
					<view class="left">
						<uni-icons type="download" size="20"></uni-icons>
						<view class="text">我的下载</view>
					</view>
					<view class="right">
						<view class="text">33</view>
						<uni-icons type="right" color="#aaa" size="16"></uni-icons>
					</view>
				</navigator>
				<view class="row">
					<view class="left">
						<uni-icons type="chatboxes-filled" size="20"></uni-icons>
						<view class="text">联系客服</view>
					</view>
					<view class="right">
						<view class="text"></view>
						<uni-icons type="right" color="#aaa" size="16"></uni-icons>
					</view>
					<!-- #ifdef MP-WEIXIN -->
					<button class="contact" open-type="contact">联系客服</button>
					<!-- #endif -->
					<!-- #ifndef MP -->
					<button @click="callPhone" class="contact" open-type="contact">拨打电话</button>
					<!-- #endif -->
				</view>
			</view>
		</view>
		<view class="section">
			<view class="list">
				<view class="row">
					<view class="left">
						<uni-icons type="download" size="20"></uni-icons>
						<view class="text">我的下载</view>
					</view>
					<view class="right">
						<view class="text">33</view>
						<uni-icons type="right" color="#aaa" size="16"></uni-icons>
					</view>
				</view>
				<view class="row">
					<view class="left">
						<uni-icons type="download" size="20"></uni-icons>
						<view class="text">我的下载</view>
					</view>
					<view class="right">
						<view class="text">33</view>
						<uni-icons type="right" color="#aaa" size="16"></uni-icons>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	function callPhone(){
		uni.makePhoneCall({
			phoneNumber: '114',
			success(res){
				console.log(res)
			},
			fail(err){
				console.log(err)
			}
		})
	}
</script>

<style lang="scss" scoped>
	.user{
		.info{
			display: flex;
			align-items: center;
			flex-direction: column;
			justify-content: center;
			padding: 50rpx 0;
			.avatar{
				width: 160rpx;
				height: 160rpx;
				border-radius: 50%;
				overflow: hidden;
				.user-avatar{
					width: 100%;
					height: 100%;
				}
			}
			.ip{
				padding: 20rpx 0 6rpx;
				font-size: 40rpx;
				color: #333;
			}
			.name{
				font-size: 28rpx;
				color: #aaa;
			}
		}
	}
	.section{
		margin: 50rpx auto;
		width: 690rpx;
		border-radius: 10rpx;
		overflow: hidden;
		border: 1rpx solid #eee;
		box-shadow: 0 0 30rpx rgba(0, 0, 0, 0.05);
		.list{
			.row{
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 0 30rpx;
				height: 100rpx;
				border-bottom: 1rpx solid #eee;
				position: relative;
				background-color: #fff;
				.left{
					display: flex;
					align-items: center;
					.text{
						padding-left: 20rpx;
						color: #666;
					}
					:deep(){
						.uni-icons{
							color: $brand-theme-color !important;
						}
					}
				}
				.right{
					display: flex;
					align-items: center;
					.text{
						font-size: 28rpx;
						color: #aaa;
					}
					:deep(){
						.uni-icons{
							color: $text-font-color-3 !important;
						}
					}
				}
				.contact{
					position: absolute;
					left: 0;
					top: 0;
					width: 100%;
					height: 100rpx;
					opacity: 0;
				}
			}
			.row:last-child{
				border-bottom: none;
			}
		}
	}
</style>
